<?php

class test_product extends Toast {
    protected $prod_srv;
    public function __construct() {
        parent::__construct(__FILE__,"product");
    }
    public function  _pre() {
        $this->prod_srv = new service_l_product();
    }
    public function  _post() {
        unset($this->prod_srv);
    }

    public function test_extra_data_exists_and_indexed_by_name(){
        $extra_field =   $this->prod_srv->get_extra_field_data(1);
        $this->_assert_not_equals($extra_field,NULL);
        $this->_assert_equals(2,count($extra_field));
        $this->_assert_true(key_exists("prod_type", $extra_field));
        $this->user_msg = "Product with id 1 has 2 extra data indexed by field name";
    }

}

?>